<div class="col-jy" style="width:100%;">
<div class="panel form-horizontal">
<div class="page-header"><h4>基本信息</h4></div>
<div class="panel-body">
<div class="alert alert-success alert-dismissable ng-scope">
		<i class="fa fa-bullhorn alert-link"></i>[<red>温馨提示</red>]:<br>
		[温馨提示]：只显示上课时间（星期），所属区域，已经启用都满足条件的讲师！
</div>
<div class="form-group ">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">上课时间</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<input type="text" class="form-control" ng-model="pagedata.item.week_daystitle" ng-readonly="true" readonly="readonly">
	</div>
</div>
<div class="form-group ">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">课程类型</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<select class="form-control" data-live-search="true" ng-change="pagedata.upworker()" ng-model="pagedata.item.groupid">
			<option value="">请选择</option>
			<option ng-repeat="op in pagedata.groups" value="{{op.id}}" ng-selected="pagedata.item.groupid==op.id">{{op.title}}</option>
		</select>
		<div class="help-block"></div>
	</div>
</div>
<div class="form-group ">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">讲师选择</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<select class="form-control" data-live-search="true" ng-change="pagedata.uplesson()" ng-model="pagedata.item.workerid">
			<option value="">请选择</option>
			<option ng-repeat="op in pagedata.workers" value="{{op.id}}" ng-selected="pagedata.item.workerid==op.id">{{op.name}}</option>
		</select>
		<div class="help-block"></div>
	</div>
</div>
<script>
//多样搜索
require(['bootstrap.select'],function(bootstrap_select){
	 $('.selectpicker').selectpicker();
});
</script>
<div ng-if="pagedata.item.lessontitle" class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">课程名称</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<div class="help-block">{{pagedata.item.lessontitle}}</div>
	</div>
</div>
<div ng-if="pagedata.item.lessondesc" class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">老师简介</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<div class="help-block" ng-bind-html="trust(pagedata.item.lessondesc)"></div>
	</div>
</div>
<div>
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">上课月份</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<select class="form-control" data-live-search="true" ng-model="pagedata.item.onmonth">
			<option value="">上课月份</option>
			<option ng-repeat="op in pagedata.onmonths[pagedata.item.workerid]" value="{{op.id}}" ng-selected="pagedata.item.onmonth==op.id">{{op.title}}</option>
		</select>
	</div>
</div>
<div class="form-group">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">上课时间</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<select class="form-control" data-live-search="true" ng-model="pagedata.item.onday">
			<option value="">上课时间</option>
			<option ng-repeat="op in pagedata.onmonths[pagedata.item.workerid][pagedata.item.onmonth].list" value="{{op.id}}" ng-selected="pagedata.item.onday==op.id">{{op.title}}</option>
		</select>
	</div>
</div>
</div>
<div class="form-group ">
	<label class="col-xs-12 col-sm-3 col-md-2 right-label">排序</label>
	<div class="col-xs-12 col-sm-8 col-lg-9">
		<input type="text" class="form-control" ng-model="pagedata.item.paixu">
	</div>
</div>
</div>
</div>
<div class="modal-sub">
<button class="btn btn-primary" ng-click="check_form();post(pagedata.item,'post')">提交</button>
</div>
</div>
<script>
scope.pagedata.upworker=function(){
	var groupid=scope.pagedata.item.groupid;
	var week_days=scope.pagedata.item.week_days;
	var area_id=scope.pagedata.area_id;
	scope.get('jy_kexie/get_data/getworker/groupid='+groupid+'&week_days='+week_days+'&area_id='+area_id,function(res){
		scope.pagedata.workers=res.list;
		scope.$evalAsync();
	});
}
scope.pagedata.upworker();
scope.pagedata.uplesson=function(){
	var groupid=scope.pagedata.item.groupid;
	var workerid=scope.pagedata.item.workerid;
	console.log(groupid);
	console.log(workerid);
	scope.pagedata.item.lessontitle=scope.pagedata.workers[workerid].lessontitle
	scope.pagedata.item.lessondesc=scope.pagedata.workers[workerid].desc
	scope.$evalAsync();
}
</script>